package session1.test.threadTest.test1;

public class Main {
	static int i=0;
	static boolean started =false;
	public static void main(String[] args) {int i=0;
		try{
			Runnable runnable ;
			Thread thread,owner;
			runnable= () -> {
				System.out.println(Main.i++);
				System.out.println();
			};
			thread = new Thread(runnable);
			while (Main.i < 1000) {
				if(thread.isInterrupted())
						Thread.currentThread().notify();
				else	thread.start();
				thread.wait();
			}
		}
		catch (Exception e){
			System.out.println(e.getMessage());
		}
	}
}

